//创建多个Promise
const p1 = new Promise((resolve,reject)=>{
    setTimeout(()=>{
        resolve(111111)
    },1000)
})

const p2 = new Promise((resolve,reject)=>{
    setTimeout(()=>{
        reject(222222)
    },2000)
})

const p3 = new Promise((resolve,reject)=>{
    setTimeout(()=>{
        resolve(333333)
    },3000)
})

//  需求：所有的Promise都变成fulfilled时，再拿到结果
//  
Promise.all([p1,p2,p3,"aaaaaa"]).then(res =>{
    console.log("res",res)
}).catch(err=>{
    console.log("err",err)
})